package com.parktech.sun.web.controller;

import com.parktech.sun.domain.service.sunhz.EnterpriseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

/**
 * User: Think
 * Date: 11-1-24
 * Time: 上午4:07
 */
@Controller
public class MemberAuthController {

    private EnterpriseService enterpriseService;

    @Autowired
    public MemberAuthController(EnterpriseService enterpriseService) {
        this.enterpriseService = enterpriseService;
    }

    @RequestMapping("/memberauth")
    @ResponseBody
    public String checkMemberCode(@RequestParam("memberCode") String memberCode) {
        if (enterpriseService.checkMemberCode(memberCode)) {
            return "{\"result\":\"true\"}";
        } else {
            return "{\"result\":\"false\"}";
        }
    }
}
